package com.moniteach.bo;

import org.json.JSONException;
import org.json.JSONObject;

import com.moniteach.constaints.C;

public class UserInfo {
	private String email;
	private String password;
	private String fName;
	private String lName;
	private String sName;
	private String phone;
	private String role;
	private String pincode;
	private long id;

	public UserInfo(String email, String fName, String lName, String sName,
			String role) {
		super();
		this.email = email;
		this.fName = fName;
		this.lName = lName;
		this.sName = sName;
		this.role = role;
	}

	public UserInfo(String fName, String lName, String sName) {
		super();
		this.fName = fName;
		this.lName = lName;
		this.sName = sName;
	}

	public UserInfo(String email, String password, String fName, String lName,
			String sName, String phone, String role, String pincode) {
		super();
		this.email = email;
		this.password = password;
		this.fName = fName;
		this.lName = lName;
		this.sName = sName;
		this.phone = phone;
		this.role = role;
		this.pincode = pincode;
	}

	public UserInfo(JSONObject jo) {
		super();
		try {
			this.id = jo.getLong(C.Const.id);
			this.email = jo.getString(C.Const.email);
			this.fName = jo.getString(C.Const.fName);
			this.lName = jo.getString(C.Const.lName);
			this.sName = jo.getString(C.Const.sName);
			this.role = jo.getString(C.Const.role);
			this.phone = jo.getString(C.Const.phone);
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	public String getFio() {
		return this.lName + " " + this.fName + " " + this.sName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getfName() {
		return fName;
	}

	public void setfName(String fName) {
		this.fName = fName;
	}

	public String getlName() {
		return lName;
	}

	public void setlName(String lName) {
		this.lName = lName;
	}

	public String getsName() {
		return sName;
	}

	public void setsName(String sName) {
		this.sName = sName;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getPincode() {
		return pincode;
	}

	public void setPincode(String pincode) {
		this.pincode = pincode;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getId() {
		return id;
	}

}
